﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LabMS.Web.Equipment.Instrument
{
    public partial class instrumentrepairquery : Base.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("SYYQHZ");//必须写在ispostback外
            strPageUserType.Add("mana");

            if (!Page.IsPostBack)
            {
                bind(" Type='yiqi' and GoodsMaintain.status<>'丢失' ");
            }
        }

        public void bind(string strWhere)
        {
            ExtendBLL.GoodsMaintain bgm = new ExtendBLL.GoodsMaintain();
            List<ExtendModule.GoodsMaintain> gm = bgm.GetExtendModuleList(strWhere);
            gvInstrument.DataSource = gm;
            gvInstrument.DataBind();
        }
        protected void GridViewConsum_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            gvInstrument.PageIndex = e.NewPageIndex;
            if (!tbKeyWords.Text.Trim().Equals(""))
            {
                string strwhere = "  Type='yiqi' and GoodsMaintain.status<>'丢失' and GoodsMaintain." + ddlCClass.SelectedValue + " like '%" + tbKeyWords.Text.Trim() + "%;";
                bind(strwhere);
            }
            else
            {
                bind(" Type='yiqi' and GoodsMaintain.status<>'丢失' ");
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (!tbKeyWords.Text.Trim().Equals(""))
            {
                string strwhere = " Type='yiqi' and GoodsMaintain.status<>'丢失' and GoodsMaintain." + ddlCClass.SelectedValue + " like '%" + tbKeyWords.Text.Trim() + "%'";
                bind(strwhere);
            }
        }

        protected void lbRefresh_Click(object sender, EventArgs e)
        {
            bind(" Type='yiqi' and GoodsMaintain.status<>'丢失' ");
        }

    }
}
